import {Service, action} from "adajs";
import KaoqinList from "../../../controls/lists/kaoqin";

class NewsService extends Service {
    defaultData() {
        return {
            title: "",
            id: "",
            list: {
                url: "/api/lgb/app/lgb/branchcheckin/getByPerson",
                type: KaoqinList,
                parameter: {
                    oldPersonId: ""
                }
            }
        };
    }

    onupdate(current, data) {
        Object.assign(current, data);
    }

    @action("load")
    load(current, id) {
        current.id = id;
        current.list.parameter.oldPersonId = id;
    }
}

export default NewsService;